package com.demo.oauth2jFinalShiroClient.handle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jfinal.handler.Handler;

/**
 * 对于没有cookie的时候会传递url会带上sessionId导致action跳入404
 */
public class SessionIdHandler extends Handler {

    @Override
    public void handle(String target, HttpServletRequest request, 
            HttpServletResponse response, boolean[] isHandled) {
    	if (target.indexOf(';') != -1) {
    		target = request.getServletPath();	//用于解决 /login;jsessionid=的问题(不管cookie禁用与否)
		}
        next.handle(target, request, response, isHandled);
    }

}